﻿using d1Project.Tools.JsonParse;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace d1Project.Modules.Common.do4A.Models
{
    public class Operation
    {
        public Operation(doJsonNode _jsonNode)
        {
            this.loadData(_jsonNode);
        }

        private void loadData(doJsonNode _jsonNode)
        {
            this.Id = _jsonNode.GetOneInteger("Id", 0);
            this.Name = _jsonNode.GetOneText("Name", "");
        }

        /// <summary>
        /// 操作Id (只能是2的n次方: 1, 2, 4, 8, 16, 32, 64)
        /// </summary>
        public int Id { get; private set; }

        /// <summary>
        /// 操作名称
        /// </summary>
        public string Name { get; private set; }

    }
}